package com.candy.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.demoweb.model.dao.BoardDao;
import com.demoweb.model.dto.Board;
import com.demoweb.ui.ThePager;

@WebServlet("/candy/writeform.action")
public class ItemWriteFormServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		//admin 만 로그인 글쓰기 가능 
//				if (request.getSession().getAttribute("admin") == null) {
//					response.sendRedirect(
//						"/demoweb/account/loginform.action?" + 
//						"returnuri=" + request.getRequestURI());
//					return;
//				}
		
		
		RequestDispatcher dispatcher = 
			request.getRequestDispatcher("/WEB-INF/views/candy/candywriteform.jsp");

		dispatcher.forward(request, response);
		
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
